import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description: 队列的测试学习
 */

interface Animal {
    void run();
}

class Duck implements Animal {

    @Override
    public void run() {
        System.out.println("鸭子在跑");
    }

    public void swim() {
        System.out.println("鸭子在游泳");
    }
}

public class Test {
    public static void main(String[] args) {
        Animal duck = new Duck();
        duck.run();
        ((Duck) duck).swim();
        Queue<Integer> queue = new LinkedList<>();
        queue.add(1);
        //Queue之所以能够调用size()方法，就是因为Queue本身继承了Collection接口
        //而Collection接口里面包含了size()方法
        System.out.println(queue.size());
    }
    public static void main1(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        int ret = myStack.pop();
        System.out.println(ret);
        boolean f = myStack.empty();
        System.out.println(f);
    }


}
